home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swaga_c.zip / COMM.SWG / 0012_Ring Detect.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  2KB  |  32 lines

  1. (*******************************************************************)
  2.  Program RingDetector;  { TSR to detect telephone ring via modem    }
  3.  {$M $400,0,0}
  4.  Uses   Dos;            { import GetIntVec, SetIntVec               }
  5.  Const  COMport     = $3FE;             { COM1 = $3FE, COM2 = $2FE  }
  6.         RingMsg     : Array [0..7] of Byte =
  7.                     ( $52,$40,$49,$40,$4E,$40,$47,$40 );   { "RinG" }
  8.  Var    OldClock    : Procedure;        { For previous int vector   }
  9.         GSpot       : Byte Absolute $B800:$072C;    { display area  }
  10.         OldScreen   : Array [0..7] of Byte; { to save display are   }
  11.  {$F+}
  12.  Procedure RingDetect; Interrupt;
  13.     begin
  14.         if ODD(Port[COMport] SHR 6)
  15.         then begin
  16.             Move( GSpot, OldScreen, 8 );        { save screen area  }
  17.             While ODD(PorT[COMport] SHR 6)
  18.                 do Move( RingMsg, GSpot, 8 );   { display "RinG"    }
  19.             Move( OldScreen, GSpot, 8 );        { restore screen    }
  20.         end; {if}
  21.         InLine($9C);                            { to fake an inT    }
  22.         OldClock;                               { chain ticker      }
  23.     end {RingDetect};
  24.  {$F-}
  25.  
  26.  begin
  27.         GetIntVec($1C,@OldClock);               { save current isr  }
  28.         SetIntVec($1C,ADDR(RingDetect));        { install this isr  }
  29.         Keep(0);                                { tsr               }
  30.  end {RingDetector}.
  31. (*******************************************************************)
  32.